/*------------------------------------------------------*/
/* dblog interface                                      */
/*                                                      */
/* dbloginterface.h                                     */
/*                                                      */
/* Copyright (C) WebEx Communications Inc.              */
/* All rights reserved                                  */
/*														*/
/* Author                                               */
/*    Jobs Chen (jobsc@hz.webex.com)                    */
/*                                                      */
/* History                                              */
/*    06/24/2004  Create                                */
/*    06/28/2004  modified by Slade Zhang               */
/*                                                      */
/*------------------------------------------------------*/
#ifndef __WBX_DBLOG_API_H__
#define __WBX_DBLOG_API_H__

#include "CmDefines.h"

//Notify DB status, dwStatus,0:normal, other:abnormal
class IDBLogInterfaceSink
{
public:
	virtual void NotifyDBStatus(DWORD dwStatus) = 0;
};

/*class IDBLogInterface
Note:
	for db log, application should give sql to it, when db log get the sql,
	it save the sql into file first, db log will create a thread, in this 
	thread, it will get the sql from the file then handle it with database,
	in this way, we can be sure that all data which application give to it 
	will be safe.
*/

class IDBLogInterface//it should be singltong
{
public:
	virtual CmResult Init(const char* strDBServer,
					const char* strDBName,
					const char* strUserName,
					const char* strPasswd,
					IDBLogInterfaceSink* pSink) = 0;

	virtual void Destroy() = 0;

	virtual CmResult HandleSQL(const char* strSQL) = 0;
	static IDBLogInterface* SingltonInstanc();	
};

extern "C"
{
	IDBLogInterface* DBLogInstance();
}

#endif//!__WBX_DBLOG_API_H__

